Updated to allow for reference images/cats; can be used for drz now.