Added check for blacklisted device.  Created insert queries for device and image