Yes, there is a way.
1. Use LP_XMLConverter to turn your .gsm into hsf file format
2. In the hsf folder structure create an "images" folder next to your "scripts" folder and put your images there
3. Open the libpartdata.xml file to refer to your images
More on hsf source format and libpartdata.xml and its syntax on the GDL Center
4. Use LP_XMLConverter to turn your hsf back to .gsm
5. Refer to your images by their number in your code!
Let me know if you have any other questions!