Fixed a stack trace if there are no product gallery