The lines that get added in my opinion are coming from the master page template used to create the template used for the page where the image gallery is placed.
To best isolate the cause create a new page without selecting a template (select start from scratch radio button) and place the gallery widget there I suppose you will not encounter the same problem. Review the markup on the master page and the css loaded on the frontend theme or as inline styles to the master page to see if there is a border added to some of the elements there that appear as the black line form the screenshot.
The difference between edit screen and publish/preview is because in page edit Sitefinity uses its own page rendering engine and at the frontend the default ASP.NET web forms rendering engine is used.
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking
system and vote to affect the priority of the items