fixed script - only supports jpg now