updated code to remove sourcelayer once the locations have been parsed.
corrected the way to reference top layer (which isn't the index zero layer).
tightening up margins to get as much photo as possible.