Now working even if elements is a single image
Removed empty if