If you want to take a screenshot without the UI elements, there's an even easier way: F6. No need to turn off the UI manually and have to turn it back on again.
Also, when taking a screenshot, make sure the cursor isn't hovering over the ship, to avoid the cursor cube.